<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ManageRoles.aspx.cs" Inherits="Administration_ManageRoles" CodeFileBaseClass="BaseView"
    ViewName="ManageRoles" %>

<%@ Register Src="../Controls/Common/WaterMarkedTextBox.ascx" TagName="WaterMarkedTextBox"
    TagPrefix="crux" %>
<%@ Register Src="../Controls/Common/ErrorNotification.ascx" TagName="ErrorNotification"
    TagPrefix="crux" %>
<%@ Register Src="../Controls/Common/TableSortSearchPagination.ascx" TagName="TableSortSearchPagination"
    TagPrefix="uc1" %>
<%@ Register Src="../Controls/Common/AdditionalButtonsOnGrid.ascx" TagName="AdditionalButtonsOnGrid"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <!-- 
        CreativeToDo: The Text Boxes On This Page Don't Change Their BackGround Like Login Page 
             when Validations are not satified 
        -->
    <asp:UpdatePanel ID="updUpdate" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlList" runat="server">
                <asp:Panel runat="server" ID="pnlAddRole">
                    <table cellpadding="0" cellspacing="0" class="toolbar">
                        <tr>
                            <td>
                                <asp:ImageButton ID="btnAddNewRole" runat="server" OnClick="btnAddNewRole_Click"
                                    meta:resourcekey="btnAddNewRoleResource2" />
                                &nbsp;<asp:ImageButton ID="btnBack" Text="Back" runat="server" OnClick="btnBack_Click"
                                    ImageUrl="~/appimages/back.gif" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <table>
                    <tr>
                        <td height="12">
                        </td>
                    </tr>
                </table>
                <uc1:TableSortSearchPagination ID="TableSortSearchPagination1" TargetControlID="grdRoles"
                    runat="server" ExcludeSortColumnCsv="2" EnableSearching="false" />
                <asp:GridView ID="grdRoles" runat="server" OnRowDataBound="grdRoles_RowDataBound"
                    AutoGenerateColumns="False" SkinID="Paginate">
                    <Columns>
                        <asp:BoundField DataField="RoleID" HeaderText="Role ID" ItemStyle-CssClass="GridFirstColumn" />
                        <asp:BoundField DataField="RoleName" HeaderText="Role Name" />
                        <asp:TemplateField HeaderText="Actions" ItemStyle-CssClass="ActionButtons">
                            <ItemTemplate>
                                <center>
                                    <asp:Panel runat="server" ID="pnlEditDeleteRole">
                                        <asp:ImageButton ID="btnItemEditIcon" runat="server" CausesValidation="false" CommandName="EditItem"
                                            OnCommand="grdRoles_RowCommand" CommandArgument='<%#Eval("RoleID")%>' ImageUrl="~/appimages/Edit.gif"
                                            ToolTip='<%# "Edit " + Resources.Strings.RoleText + " details"%>' />
                                        <asp:ImageButton ID="btnItemDelete" runat="server" CausesValidation="false" CommandName="DeleteItem"
                                            OnCommand="grdRoles_RowCommand" CommandArgument='<%#Eval("RoleID")%>' ImageUrl="~/appImages/delete.gif"
                                            ToolTip='<%# "Delete " + Resources.Strings.RoleText  %>' />
                                        <!-- CreativeTodo: Have Icon For 'Manage Departments' -->
                                    </asp:Panel>
                                    <asp:Panel runat="server" ID="pnlAdditionalConfigurationBasedButtons">
                                        <uc1:AdditionalButtonsOnGrid runat="server" ObjectID='<%#Eval("RoleID")%>'
                                            GridName="ManageRoles" />
                                    </asp:Panel>
                                </center>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:Panel ID="pnlAddEdit" runat="server">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td class="formTxtHeader" colspan="2">
                            Role Management
                        </td>
                    </tr>
                    <tr>
                        <td class="formLine" colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <!-- <%# Resources.Strings.RoleText %> ID -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblRoleID" runat="server" Text='<%# Resources.Strings.RoleText + " ID:"%>'
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <asp:Label ID="lblRoleIDValue" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- <%# Resources.Strings.RoleText %> Name -->
                    <tr>
                        <td align="right" valign="middle" class="formLeftColmnWidth">
                            <asp:Label ID="lblRoleName" runat="server" Text='<%# Resources.Strings.RoleText + " Name:"%>'
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtRoleName" WaterMarkText="Role Name" ValueRequired="true"
                                ErrorText="Role Name is required" Width="180" MaxLength="50" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- <%= Resources.Strings.RoleText %> Description -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblRoleDescription" runat="server" Text='<%# Resources.Strings.RoleText + " Description:"%>'
                                CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtRoleDescription" WaterMarkText="Role Description"
                                ValueRequired="false" TextMode="MultiLine" Width="180" Height="30" MaxLength="200"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- <%= Resources.Strings.RoleText %> comments -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth formPaddingTop">
                            <asp:Label ID="lblComments" runat="server" Text="Comments:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth">
                            <crux:WaterMarkedTextBox ID="txtComments" WaterMarkText="Comments" ValueRequired="false"
                                TextMode="MultiLine" Width="180" Height="30" MaxLength="200" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- <%= Resources.Strings.RoleText %> Privileges -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth02 formPaddingTop02">
                            <asp:Label ID="lblPrivilagesToRepresent" runat="server" Text="Privileges:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth02">
                            <asp:CheckBoxList ID="chkPrivilages" runat="server">
                            </asp:CheckBoxList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formFieldGap">
                        </td>
                    </tr>
                    <!-- Company Comments -->
                    <tr>
                        <td align="right" valign="top" class="formLeftColmnWidth02 formPaddingTop02">
                            <asp:Label ID="lblCompanyTypesToRepresent" runat="server" Text="Company Types:" CssClass="formLabel"></asp:Label>
                        </td>
                        <td align="left" valign="middle" class="formRightColmnWidth02">
                            <asp:CheckBoxList ID="chkCompanyTypes" runat="server">
                            </asp:CheckBoxList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="formGroupGap">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="left">
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                            &nbsp;
                            <asp:Button ID="btnCancel" runat="server" CausesValidation="false" Text="Cancel"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <crux:ErrorNotification ID="pnlError" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
